package com.shortlink.gateway.remote;

import com.shortlink.common.base.Result;
import com.shortlink.common.constant.HeaderConstant;
import com.shortlink.common.user.UserInfoDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 权限认证远程调用服务
 *
 * @author wp
 */
@FeignClient(
        name = "shortlink-aggregation",
        path = "/shortlink-aggregation"
)
public interface AuthRemoteService {
    /**
     * 用户认证
     */
    @GetMapping("/api/auth")
    Result<UserInfoDTO> auth(@RequestHeader(HeaderConstant.AUTHORIZATION) String token, @RequestParam("requestPath") String requestPath);
}